package com.guard.net;

import com.guard.structures.SystemStatus;
import com.guard.ui.AbstractActivity;

public class UpdateStatusController extends UpdateController {

    public UpdateStatusController(AbstractActivity activity) {
        super(activity);
    }

    @Override
    public void onFinished(Object obj) {
        super.onFinished(obj);

        if (mActivity != null) {
            if (obj instanceof HttpConnectionError) {
                mActivity.showConnectionErrorDialog();
            } else if (obj instanceof SystemStatus) {
                mActivity.onUpdateStatus((SystemStatus) obj);
            }
        }
    }

    @Override
    public UpdateTask getUpdateTask() {
        return new UpdateStatusTask();
    }

}
